package com.durian.system.aliyun;

import java.util.HashMap;
import java.util.Random;

public class MyTest {
    public static void main(String[] args) {
        //生成4位数字验证码 hhh
        Random random = new Random();
        String code = "";
        for (int i = 0; i <4 ; i++) {
            code+=random.nextInt(10);
        }
        //创建一个map存手机号和验证码
        HashMap<String,Object> map = new HashMap<>();
        //接收验证码的手机号,必须是添加在测试短信的手机号
        map.put("telephoneNumber","18403465663");
        //生成的验证码
        map.put("code",code);
        //调用发送短信
        try {
            //调用发送短信配置类
            Sample.sendTextMessage(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
